code refactoring, sight direction still not finished