Implement 2 functions corresponding to 2 commands (open, check).

These functions will bring easier unit testing.