added css method, some other refactoring