Start implementing file handler and some improvements