Cleaned up RBM classes code