fixing status method and some refactoring